<?php
/**
 * ExtButtonBase class file
 *
 * @author TrueSoftware B.V. (The Netherlands)
 * @link http://www.ext4yii.com
 * @copyright Copyright 2007-2010 TrueSoftwareB.V. all rights reserved.
 * @license http://www.ext4yii.com/license/
 *          EVALUATION VERSION - NOT FOR COMMERCIAL USE OR DISTRIBUTION.
 * @version 0.7.2
 */

class ExtMenuPanelBase extends ExtPanel
{
    public function init()
    {
        parent::init();
        $this->getController()->addUxScript('MenuPanel.js');
    }
    
    public function parseNode(ExtHTMLParserNode $node,
        ExtASTWalker $astwalker)
    {
        parent::parseNode($node, $astwalker);
        $this->parseMenu($node, $astwalker,'menu');
    }

    public function renderConfig($asobject=true)
    {
        $this->deleteConfig('selectedIndex');
        if($this->getSelectedIndex() != '')
            Yii::app()->getController()->addAfterInitScript(sprintf('Ext.getCmp("%s").setSelectedIndex(%s)',$this->getId(),$this->getSelectedIndex()));
        return parent::renderConfig($asobject);
    }
}
?>
